﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XChipMatlab
{
    using global::XChipCadj;
    using MathWorks.MATLAB.NET.Arrays;
    using MathWorks.MATLAB.NET.Utility;
    public class XChipCadj
    {
        public Cadj ca;

        public XChipCadj() {
            ca = new Cadj();
        }

        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }
        /// <summary>
        ///  cadj 生成
        /// </summary>
        /// <param name="image_name_src_in1">输入图片</param>
        /// <param name="image_name_dst_in1">输出图片</param>
        /// <param name="reg_file_name_in1">输出寄存器文本</param>
        /// <param name="_reg_click">坐标</param>
        /// <param name="_boundaryArr">ROI: region of interest</param>
        /// <param name="_enArr">使能</param>
        /// <param name="_rgbpArr">参数值</param>
        /// <returns></returns>
        public string[] CadjGen(string image_name_src_in1,string image_name_dst_in1,string reg_file_name_in1,double[,] _reg_click,int[,] _boundaryArr,int[] _enArr,int[] _rgbpArr) {
            string[] strList = new string[3];
            //MWArray image_name_src_in1 = @"D:\Common\Matlab\cadj_tool\00.bmp";
            //MWArray image_name_dst_in1 = @"C:\Users\Administrator.DESKTOP-LRGNSJU\Desktop\01.bmp";
            //MWArray reg_file_name_in1 = @"C:\Users\Administrator.DESKTOP-LRGNSJU\Desktop\reg_chroma_adjust.txt";
            MWArray reg_click = (MWNumericArray)_reg_click;
            MWArray boundaryArr = (MWNumericArray)_boundaryArr;
            MWArray enArr = (MWNumericArray)_enArr;
            MWArray rgbpArr = (MWNumericArray)_rgbpArr;
            var caArr = ca.para_ini(3, image_name_src_in1, image_name_dst_in1, reg_file_name_in1, reg_click, boundaryArr, enArr, rgbpArr);
            for (int i = 0; i < caArr.Count(); i++)
            {
                strList[i] = caArr[i].ToString();
            }
            return strList;
        }
    }
    
}
